package run.vue.iblog.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import run.vue.iblog.common.Result;
import run.vue.iblog.common.ResultFactory;
import run.vue.iblog.service.CategoryService;

@RestController
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    // 获取所有分类
    @GetMapping(value = "/categories")
    public Result getCategories(){
        System.out.println(categoryService.listAll());
        return ResultFactory.success(categoryService.listAll());
    }
}
